<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
            1楼
               卖的是服装
            2楼
            3楼
                卖的是日用品
            4楼
            5楼
            6楼
                卖的是家电
            其他
                杂货
            要求使用    
                switch和if语句
        */
        var floor = 4;
        switch (floor) {
            case 1:
                console.log("卖的是服装");
                break;
            case 2:
            case 3:
                console.log("卖的是服装");
                break;
            case 4:
            case 5:
            case 6:
                console.log("卖的是家电");
                break;
            default:
                console.log("杂货");
        }





        // var floor = 2;
        // if(floor == 1){
        //     console.log("卖的是服装");
        // }else if(floor == 2 || floor == 3){
        //     console.log("卖的是日用品");
        // }else if(floor == 4 || floor == 5 || floor == 6){
        //     console.log("卖的是家电");
        // }else{
        //     console.log("杂货");
        // }


    </script>
</body>

</html>